package com.bigpang.framework.cglibProxy;

import net.sf.cglib.proxy.Enhancer;

/**
 * @Author YongQiang
 * @Date 2021/7/13 15:06
 * @Version 1.0
 */
public class MyCglibProxyTest {
    public static void main(String[] args) {

        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(HelloService.class);
        enhancer.setCallback(new MyMethodInterceptor());
        HelloService helloService = (HelloService) enhancer.create();
        helloService.sayHello();
    }
}
